/**
 * 
 */
package com.thor.palmmall.rest.chart.converter;

import org.springframework.core.convert.converter.Converter;

import com.thor.palmmall.rest.chart.ALoginInfo;
import com.thor.palmmall.spi.chart.SLoginInfo;

/**
 * @author NuoSa
 *
 * @since 1.0
 */
public class SLoginInfoConverter implements Converter<ALoginInfo, SLoginInfo> {

  public static SLoginInfoConverter getInstance() {
    if (instance == null)
      instance = new SLoginInfoConverter();
    return instance;
  }

  private static SLoginInfoConverter instance;

  private SLoginInfoConverter() {
  }

  @Override
  public SLoginInfo convert(ALoginInfo source) {
    if (source == null) {
      return null;
    }
    SLoginInfo target = new SLoginInfo();
    target.setPrincipal(source.getPrincipal());
    target.setDate(source.getDate());
    return target;
  }

}
